package com.xayy.health.mgt.mapper;

import cn.kawins.mybatis.BaseMapper;
import com.xayy.health.core.config.datasource.DatasourceSelector;
import com.xayy.health.mgt.model.AppTlmCheckAnomalRslt;
import com.xayy.health.mgt.model.DiagnoseMultipleParametersData;
import com.xayy.health.mgt.model.vo.DataSourceVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author zhangxa
 */
public interface AppTlmCheckAnomalRsltMapper extends BaseMapper<AppTlmCheckAnomalRslt> {

    /**
     * 执行sql指定数据源
     *
     * @param dataSourceVo 查询条件入参
     * @return List<Map < String, Object>>
     */
    List<Map<String, Object>> selectAppTlmCheckData(@Param("dataSourceVo") DataSourceVo dataSourceVo);

    /**
     * 根据sql查询pg库数据
     * @param sql sql语句
     * @return List<DiagnoseMultipleParametersData>
     */
    @DatasourceSelector(sourceName = "clickhouse")
    List<DiagnoseMultipleParametersData> getClickHouseBySql(String sql);

}
